package com.ewanghuiju.app.ui.pintuan.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewanghuiju.app.R;
import com.ewanghuiju.app.component.ImageLoader;
import com.ewanghuiju.app.model.bean.response.PingjiaListResponBean;
import com.makeramen.roundedimageview.RoundedImageView;
import com.willy.ratingbar.ScaleRatingBar;

public class PintuanShopDetailsPjAdapter extends BaseQuickAdapter<PingjiaListResponBean, BaseViewHolder> {

    public PintuanShopDetailsPjAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, PingjiaListResponBean item) {
        helper.setText(R.id.tv_pingjia_name, item.getNickname());
        helper.setText(R.id.tv_pingjia_time, item.getCreate_time());
        helper.setText(R.id.tv_pingjia_text, item.getContent());
        RoundedImageView iv_head = helper.getView(R.id.riv_head);
        ImageLoader.load(mContext, item.getUser_image(), iv_head);
        ScaleRatingBar scaleRatingBar = helper.getView(R.id.simpleRatingBar);
        scaleRatingBar.setRating(item.getStars());
    }
}
